//
//  BalanceViewCell.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/4/29.
//  Copyright © 2019 SanYi. All rights reserved.
//

#import "BalanceViewCell.h"

@implementation BalanceViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubView];
    }
    return self;
}
- (void)initSubView{
    self.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.backView];
    [_backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.centerY.equalTo(self.mas_centerY);
        make.width.equalTo(@0).offset(549);
        make.height.equalTo(@50);
    }];
    [_backView addSubview:self.leftLabel];
    [_backView addSubview:self.centerLabel];
    [_backView addSubview:self.rightLabel];
    [_leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@10);
        make.centerY.equalTo(self->_backView.mas_centerY);
        make.width.equalTo(@100);
        make.height.equalTo(@20);
    }];
    [_centerLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self->_backView.mas_centerX);
        make.centerY.equalTo(self->_backView.mas_centerY);
        make.width.equalTo(@80);
        make.height.equalTo(@20);
    }];
    [_rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self->_backView.mas_right).offset(-10);
        make.centerY.equalTo(self->_backView.mas_centerY);
        make.width.equalTo(@150);
        make.height.equalTo(@20);
    }];
}
- (UIView *)backView{
    if (!_backView) {
        UIView *view = [[UIView alloc]init];
        view.backgroundColor = [UIColor clearColor];
        view.layer.cornerRadius = 5;
        view.layer.masksToBounds = YES;
        view.layer.borderColor = LINCOLOR.CGColor;
        view.layer.borderWidth  = 1;
        view.layer.masksToBounds = YES;
        _backView = view;
    }
    return _backView;
}
- (UILabel *)leftLabel{
    if (!_leftLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(401,122.5,83,13.5);
        label.numberOfLines = 0;
        label.text =@"学生补课消课";
        label.font = [UIFont systemFontOfSize:14];
        label.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
        
        _leftLabel = label;
    }
    return _leftLabel;
}
- (UILabel *)centerLabel{
    if (!_centerLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(401,122.5,83,13.5);
        label.numberOfLines = 0;
        label.text =@"1200.00";
        label.font = [UIFont systemFontOfSize:14];
        label.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
        _centerLabel = label;
    }
    return _centerLabel;
}
- (UILabel *)rightLabel{
    if (!_rightLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(401,122.5,83,13.5);
        label.textAlignment = 2;
        label.text =@"03月18日 07: 59";
        label.font = [UIFont systemFontOfSize:14];
        label.textColor = [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1.0];
        
        _rightLabel = label;
    }
    return _rightLabel;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
